package io.kiki.sba.registry.server.clientInterface.remoting.handler;

import io.kiki.sba.registry.api.Channel;
import io.kiki.sba.registry.core.model.PublisherRegister;
import io.kiki.sba.registry.core.model.RegisterResponse;
import io.kiki.sba.registry.server.clientInterface.strategy.PublisherHandlerStrategy;
import org.springframework.beans.factory.annotation.Autowired;


public class PublisherHandler extends AbstractClientDataRequestHandler<PublisherRegister> {

    @Autowired
    PublisherHandlerStrategy publisherHandlerStrategy;

    @Override
    public Object doHandle(Channel channel, PublisherRegister publisherRegister) {
        RegisterResponse result = new RegisterResponse();
        publisherHandlerStrategy.handlePublisherRegister(channel, publisherRegister, result);
        return result;
    }

    @Override
    public Class interest() {
        return PublisherRegister.class;
    }
}
